package schoolword2;

class Juxing{
    private double length;
    private double width;

    public Juxing(double length, double width) {
        this.length = length;
        this.width = width;
    }

    public double findArea() {
        return length * width;
    }
}

class Changfangti extends Juxing {
    private double height;

    public Changfangti(double length, double width, double height) {
        super(length, width);
        this.height = height;
    }

    public double findVolume() {
        return findArea() * height;
    }
}
public class Test {
    public static void main(String[] args) {
        Changfangti changfangti = new Changfangti(2,5,7);
        System.out.println("底面积:" + changfangti.findArea());
        System.out.println("体积:" + changfangti.findVolume());
    }
}
